#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void Left_turn(char* p, size_t len,int k)
{
	int i = 0;
	for (i = 0; i < k; i++)
	{
		int tmp = *(p + i);
		int j = 0;
		for (i = 0; i < len - 1; i++)
		{
			*(p + i) = *(p + i + 1);
		}
		*(p + i) = tmp;
	}
}

int main()
{
	char ch[5] = "ABCD";
	//gets(ch);
	size_t len = strlen(ch);
	int k = 0;
	scanf("%d", &k);
	Left_turn(ch, len,k);
	puts(ch);
	return 0;
}